import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    user:{},
    token:'',
    menuList:[]
  },
  mutations: {
    getUser(state,user){
      state.user = user
    },
    getToken(state,token){
      state.token = token
    },
    getMenuList(state,menuList){
      state.menuList = menuList
    }
  },
  actions: {
    getMenuListSync({commit},menu){
      commit('getMenuList',menu)
    }
  },
  modules: {
  }
})
